package base;

public class Test2 {

    public static void main(String[] args) {
        int num = 10;
        String str= "hello";
        StringBuilder sb = new StringBuilder("iphone");
        Phone phone = new Phone("iphone");
        System.out.println(num);
        System.out.println(str);
        System.out.println(sb.toString());
        System.out.println("================================");
        foo(num);
        foo(str);
        foo(sb);
        foo(phone);
        System.out.println(num);
        System.out.println(str);
        System.out.println(sb.toString());
        System.out.println(phone.toString());
        System.out.println("================================");

    }

    static void  foo(int value){
        value = 100;
    }

    static void  foo(String value){
        value = "java";
    }

    static void  foo(StringBuilder stringBuilder){
        //stringBuilder.append("4");
        stringBuilder = new  StringBuilder("1234");
    }

    static void  foo(Phone phone){
        //phone.name = "iphone5";
        phone= new Phone("123456");
    }
}

class Phone{

    String name;

    public Phone(String name){
        this.name = name;
    };

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String toString(){
        return name;
    }
}